package com.sram.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.sram.service.FunctionService;
import com.sram.service.PhotoService;
import com.sram.service.UserService;

public abstract class BaseAction  extends ActionSupport{
	protected  UserService userService;
	
	protected FunctionService functionService;
	protected PhotoService photoService;
	public PhotoService getPhotoService(){
		return photoService;
	}
	public void setPhotoService(PhotoService photoService) {
		this.photoService = photoService;
	}
	
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	public FunctionService getFunctionService() {
		return functionService;
	}
	public void setFunctionService(FunctionService functionService) {
		this.functionService = functionService;
	}
	// 简化request操作，session操作
	public HttpServletRequest getRequest() {
			return ServletActionContext.getRequest();
		}

		// 简化request操作，session操作
	public HttpServletResponse getResponse() {
			return ServletActionContext.getResponse();
		}

	public HttpSession getSession() {
			return ServletActionContext.getRequest().getSession();
		}
}
